package com.tracy.swagger.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "result",description = "返回值对象")
public class Result<T> implements Serializable {

    private static final long serialVersionUID = -3093856310515437414L;

    public static final int SUCCESS_STATUS = 200;

    public static final int FAILURE_STATUS = -1;

    @ApiModelProperty(name="code",value = "状态 200:成功 其余异常",dataType = "int")
    private int code = SUCCESS_STATUS;

    @ApiModelProperty(name="message",value = "错误信息",dataType = "String")
    private String message;

    @ApiModelProperty(name="data",value = "返回数据主体",dataType = "T")
    private T data;

}
